package com.ming.controller;

import com.ming.dao.ComplexMapper;
import com.ming.pojo.Complex;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @author Xu
 * Created by Intellij IDEA.
 * @create 2021/4/20 21:12
 */
@Controller
public class ComplexController {

    @Autowired
    ComplexMapper complexMapper;

    @GetMapping("/complex")
    public String complex(Model model){
        List<Complex> mostPackages = complexMapper.mostPackages();
        model.addAttribute("mostPackages",mostPackages);
        List<Complex> mostCustomers = complexMapper.mostCustomers();
        model.addAttribute("mostCustomers",mostCustomers);
        List<Complex> mostRecipients = complexMapper.mostRecipients();
        model.addAttribute("mostRecipients",mostRecipients);
        List<Complex> mostStaffs = complexMapper.mostStaff();
        model.addAttribute("mostStaffs",mostStaffs);
        return "complexList";
    }

}
